package com.example.teamtribe.main.club.manage;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.example.teamtribe.R;
import com.example.teamtribe.base.BaseActivity;
import com.example.teamtribe.database.Team;
import com.example.teamtribe.main.club.estimate.EstimateActivity;
import com.example.teamtribe.main.club.estimate.EstimateAdapter;
import com.example.teamtribe.main.club.estimate.EstimateListActivity;
import com.example.teamtribe.main.club.manage.applyactivity.AcAppListActivity;
import com.example.teamtribe.main.club.manage.feedback.FeedbackActivity;
import com.example.teamtribe.main.club.manage.finace.FinanceActivity;
import com.example.teamtribe.main.club.manage.statistics.StatisticsActivity;
import com.example.teamtribe.main.club.post.PostActivity;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class ManageActivity extends BaseActivity {

    private Team team;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_manage);
        ButterKnife.bind(this);
        team = getIntent().getParcelableExtra("team");
        TextView tvTitle = findViewById(R.id.tv_subTitle);
        if (team == null) {
            tvTitle.setText("长沙理工大学");
        } else {
            tvTitle.setText(team.getName());
        }
    }

    @OnClick({R.id.ll_item_apply, R.id.ll_item_send, R.id.ll_item_finance, R.id.ll_item_estimate, R.id.ll_item_statistics, R.id.ll_item_notification})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ll_item_apply:
                Intent a = new Intent(this, AcAppListActivity.class);
                a.putExtra("team", team);
                startActivity(a);
                break;
            case R.id.ll_item_send:
                Intent s = new Intent(this, PostActivity.class);
                s.putExtra("teamId", team.getRealId());
                startActivity(s);
                break;
            case R.id.ll_item_finance:
                Intent f = new Intent(this, FinanceActivity.class);
                f.putExtra("team", team);
                startActivity(f);
                break;
            case R.id.ll_item_estimate:
                startActivity(new Intent(this, EstimateListActivity.class));
                break;
            case R.id.ll_item_statistics:
                startActivity(new Intent(this, StatisticsActivity.class));
                break;
            case R.id.ll_item_notification:
                Intent n = new Intent(this, FeedbackActivity.class);
                n.putExtra("team", team);
                startActivity(n);
                break;
        }
    }
}
